package gz.copydatabase.Application;

import android.app.Application;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.speech.tts.TextToSpeech;

import gz.copydatabase.Utils.SPUtils;


//import com.gz.gzcar.utils.GetImei;

/**
 * Created by Endeavor on 2016/8/18.
 */
public class ApplicationExd extends Application {
    public static TextToSpeech speech;
    public static SPUtils settingInfo;
    public static String ID;
    public static String baseUrl ="http://192.168.10.180:3000";
    public static String version="2.0";

    private static Context context;
        @Override
        public void onCreate() {
        super.onCreate();
        settingInfo =new SPUtils(this,"config");
        settingInfo.init(this);
        ID=settingInfo.getString(SPUtils.Key.ID);
        version=getVersion();
        context=getApplicationContext();


    }
    public static Context getContext() {
        return context;
    }
    private String getVersion() {
        try {
            PackageInfo pi=this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
            return pi.versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return "";
    }
}
